using System;
using System.Collections.Generic;
using System.Text;
using DOMercury.Interfaces;

namespace DOMercury.Items
{
    /// <summary>
    /// IItem Wrapper around a block of text
    /// </summary>
    public class TextItem : IItem, IComparable
    {
        private string text;
        /// <summary>
        /// The actual text
        /// </summary>
        public string Text
        {
            get
            {
                return text;
            }
        }

        /// <summary>
        /// Returns the actual text
        /// </summary>
        public string DisplayName
        {
            get
            {
                return Text;
            }
        }

        /// <summary>
        /// returns "text"
        /// </summary>
        public string DisplayDesc
        {
            get
            {
                return "text";
            }
        }

        /// <summary>
        /// returns "text"
        /// </summary>
        public string ItemType
        {
            get
            {
                return "text";
            }
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="Text">the text to be wrapped around</param>
        public TextItem(string Text)
        {
            text = Text;
        }

        #region IComparable Members

        public int CompareTo(object obj)
        {
            return text.CompareTo(((IItem)(obj)).DisplayName);
        }

        #endregion
    }
}
